const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        brandName: 'chery',
        dealerCode: 'string',
        code: 'string',
        partInvoiceCode: 'string',
        invoiceFee: 200,
        carrierName: 'string',
        isMagnetic: true,
        isChemical: true,
        isPL: true,
        isLoading: true,
        isWarehousingAndAddress: true,
        isExpressDocuments: true,
        isRandomFiles: true,
        options: [
            'update', 'outbound'
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                partInvoiceId: 'string',
                partInvoiceCode: 'string',
                partShipmentId: '2',
                invoiceFee: 200,
                carrierId: '1',
                carrierName: 'string',
                isMagnetic: true,
                isChemical: true,
                isPL: false,
                isLoading: true,
                isWarehousingAndAddress: true,
                isExpressDocuments: true,
                isRandomFiles: true,
                isLoadingCabinet: false,
                loadingTime: '2019-09-05T06:17:26.693Z',
                loadingQuantity: 200,
                isEnteringWarehouse: false,
                deliveryTime: '2019-09-05T06:17:26.693Z',
                inboundCode: 'string',
                isExpress: true,
                expressPickupTime: '2019-09-05T06:17:26.693Z',
                detailCarrierId: '1',
                detailCarrierCode: 'string',
                detailCarrierName: 'string',
                expressCode: 'string',
                isSelfMention: false,
                collectPickupTime: '2019-09-05T06:17:26.693Z',
                consignee: 'string',
                shortContainerCount: 120,
                standardContainerCount: 240,
                highContainerCount: 360,
                rowVersion: 'string',
                options: [
                    'update', 'outbound'
                ],
            }
        }
    );
});

router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});

module.exports = router;
